package com.heart.sell.util;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**
 * 全局Json格式化工具
 *
 * @author Luo Zhen
 * @create 2019-04-26 15:46
 */
public class JsonUtil {

    public static String toJson(Object object) {
        GsonBuilder gsonBuilder = new GsonBuilder();
        gsonBuilder.setPrettyPrinting();
        Gson gson = gsonBuilder.create();
        return gson.toJson(object);
    }
}
